#include<iostream>
#include<vector>
#include<string>
#include<cmath>
using namespace std;

class Solution {
public:
    void reverseString(vector<char>& s) {
        int left = 0, right = s.size() - 1;
        while (left < right) {
            swap(s[left], s[right]);
            left++;
            right--;
        }
    }
};

int main() {
    vector<char> s = { 'h','e' ,'l','l','o' };
    Solution so;
    so.reverseString(s);
    for (int i = 0; i < s.size(); i++)
        cout << s[i] << " ";
}